using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace GameLib
{
    public class MapReader : ContentTypeReader<Map>
    {
        protected override Map Read(ContentReader input, Map existingInstance)
        {
            Map map = new Map();

            map.Name = input.ReadString();
            map.Size = input.ReadVector2();
            map.TileSize = input.ReadVector2();
            map.TextureType = input.ReadString();
            map.BackgroundLayer = input.ReadObject<int[]>();
            map.BaseLayer = input.ReadObject<int[]>();
            map.ForegroundLayer = input.ReadObject<int[]>();

            return map;
        }
    }
}
